Skip to content

Relax std::is_default_constructible_v requirement for C9Co Crubit ABIs#756

Merged
copybara-service[bot] merged 1 commit intomainfrom
test_888843585
Mar 30, 2026
Merged

Relax std::is_default_constructible_v requirement for C9Co Crubit ABIs#756
copybara-service[bot] merged 1 commit intomainfrom
test_888843585

Conversation

@copybara-service
Copy link
Copy Markdown

Relax std::is_default_constructible_v requirement for C9Co Crubit ABIs

Currently, c9::internal::rust::EncodeResultInCrubitBuffer requires the Crubit ABI type to be default constructible. This breaks for complex ABI types like rs_std::DynCallable which requires initialization arguments.

This change delegates the ABI instantiation to the caller (either the Rust binding generator or the CoCrubitAbi fallback constructor). Because some ABI types are not "structural types" in C++20 and cannot be used as template arguments directly, we pass a closure type (AbiFactory) to StartCoroutineFromRust that constructs the ABI upon invocation.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 25, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service copybara-service bot force-pushed the test_888843585 branch 8 times, most recently from 8d6bdb6 to 796a6e8 Compare March 30, 2026 16:53
Currently, `c9::internal::rust::EncodeResultInCrubitBuffer` requires the Crubit ABI type to be default constructible. This breaks for complex ABI types like `rs_std::DynCallable` which requires initialization arguments.

This change delegates the ABI instantiation to the caller (either the Rust binding generator or the `CoCrubitAbi` fallback constructor). Because some ABI types are not "structural types" in C++20 and cannot be used as template arguments directly, we pass a closure type (`AbiFactory`) to `StartCoroutineFromRust` that constructs the ABI upon invocation.

PiperOrigin-RevId: 891772056
@copybara-service copybara-service bot merged commit 559444c into main Mar 30, 2026
@copybara-service copybara-service bot deleted the test_888843585 branch March 30, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants